<template>
    <Modal width="45" :value="show" :title="title">
        <Form ref="DirectoryValidate" :model="DirectoryForm" :rules="ruleDirectoryForm" :label-width="80">
            <FormItem label="目录名称" prop="name">
                <Input v-model="DirectoryForm.name" placeholder="请输入目录名称"/>
            </FormItem>
        </Form>
        <div slot="footer">
            <Button @click="cancel">取消</Button>
            <Button type="primary" @click="ok">确定</Button>
        </div>
    </Modal>
</template>

<script>
export default {
    name: "directoryModal",
    props: {
        show: Boolean,
        title: String,
        edit: Boolean,
        id: Number
    },
    data() {
        return {
            DirectoryForm: {
                name: ""
            },
            ruleDirectoryForm: {
                name: [{required: true, message: '请输入目录名称', trigger: 'blur'}]
            }
        }
    },
    methods: {
        cancel() {
            this.$emit("closeModal", false);
        },
    }
}
</script>
